//
//  RegisteViewController.m
//  TestApplication
//
//  Created by Hanlingyu on 16/8/29.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "RegisteViewController.h"
#import "AFNetworking.h"
@interface RegisteViewController ()

@end

@implementation RegisteViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    
    
    
}


//- (void)getUserInfo {
//    // c=User&m=getValidCodeV3&p=%7B%22countryCode%22%3A%22%2B86%22%2C%22tel%22%3A%22154073404570%22%2C%22type%22%3A%22register%22%7D&t=t&v=v105
//    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
//    NSString *postURLString = @"http://api.zheli.io:9501/";
//    
//    //    self.phoneNumber = @"13029269187";
//    //    self.password = @"qwer1234";
//    
//    // c=User&m=getUserInfo&p=%7B%22id%22%3A%2257c01d33a9a36d0621c123f7%22%7D&t=t&v=v105
//    // c=User&m=getUserInfo&p=%7B%22id%22%3A%2257c01d33a9a36d0621c123f7%22%7D&t=t&v=v105
//    
//    
//    NSString *text = [NSString stringWithFormat:@"{\"id\":\"%@\"}", self.user_id];
//    NSString *utf8Text = [text stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]];
//    //    NSString *p = [self URLEncodedString:utf8Text];
//    NSString *parmeters = [NSString stringWithFormat:@"c=User&m=getUserInfo&p=%@&t=t&v=v105", utf8Text];
//    NSLog(@"%@", parmeters);
//    
//    // 确定 parameter 字符串中含有:/?#[]@!$&’()*+,;=这些字符时候，这些字符需要被转化，以免与语法冲突
//    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html", nil];
//    // 设置请求参数的字符串, 自定义
//    [manager.requestSerializer setQueryStringSerializationWithBlock:^NSString * _Nonnull(NSURLRequest * _Nonnull request, id  _Nonnull parameters, NSError * _Nullable __autoreleasing * _Nullable error) {
//        
//        return parmeters;
//    }];
//    // 正常post发送
//    [manager POST:postURLString parameters:parmeters progress:^(NSProgress * _Nonnull uploadProgress) {
//    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
//        NSLog(@"%@", task.currentRequest.HTTPBody);
//        NSLog(@"请求成功: %@", responseObject);
//        self.user = responseObject;
//        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
//        //登陆成功后把用户名和密码存储到UserDefault
//        [userDefaults setObject:_user forKey:@"user"];
//        
//        
//    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
//        NSLog(@"请求失败: %@", error);
//    }];
//    
//    
//}

- (IBAction)popLastViewControllerAction:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
